package cn.dakaqi.vo.response;

import org.springframework.data.domain.Page;

/**
 * Created by chunyang on 2016/4/25.
 */
public class DKQPage
{
    public DKQPage()
    {
    }

    public DKQPage(Page<?> page)
    {
        this.last = page.isLast();
        this.totalPages = page.getTotalPages();
        this.totalElements = page.getNumberOfElements();
        this.firstPage = page.isFirstPage();
        this.lastPage = page.isLastPage();
        this.size = page.getSize();
        this.number = page.getNumber()+1;
    }
    private boolean last;
    private int totalPages;
    private int totalElements;
    private boolean firstPage;
    private boolean lastPage;
    private int size;
    private int number;

    public boolean isLast()
    {
        return last;
    }

    public void setLast(boolean last)
    {
        this.last = last;
    }

    public int getTotalPages()
    {
        return totalPages;
    }

    public void setTotalPages(int totalPages)
    {
        this.totalPages = totalPages;
    }

    public int getTotalElements()
    {
        return totalElements;
    }

    public void setTotalElements(int totalElements)
    {
        this.totalElements = totalElements;
    }

    public boolean isFirstPage()
    {
        return firstPage;
    }

    public void setFirstPage(boolean firstPage)
    {
        this.firstPage = firstPage;
    }

    public boolean isLastPage()
    {
        return lastPage;
    }

    public void setLastPage(boolean lastPage)
    {
        this.lastPage = lastPage;
    }

    public int getSize()
    {
        return size;
    }

    public void setSize(int size)
    {
        this.size = size;
    }

    public int getNumber()
    {
        return number;
    }

    public void setNumber(int number)
    {
        this.number = number;
    }
}
